//
//(C) Copyright 2011 HongKong Airline.,Ltd. 
//
/**
 * publishNewsServiceImpl
 * 项目名称:代购系统
 *
 * @author Mengxiangliang
 *
 * 功能描述:
 * 
 * 历史版本:2013-01-04 v1.0.0 Mengxiangliang  创建:
 * 
 */
 
package com.gamutsoft.amb.publishnews.service.impl;

import java.util.List;
import java.util.Map;

import com.gamutsoft.amb.common.bean.QueryExample;
import com.gamutsoft.amb.common.exception.BusinessException;
import com.gamutsoft.amb.common.service.impl.GenericServiceImpl;
import com.gamutsoft.amb.publishnews.dao.IPublishNewsDao;
import com.gamutsoft.amb.publishnews.model.PublishNews;
import com.gamutsoft.amb.publishnews.service.IPublishNewsService;

public class PublishNewsServiceImpl extends GenericServiceImpl<PublishNews, Long> implements IPublishNewsService {
	public IPublishNewsDao publishNewsDao;

    public PublishNewsServiceImpl(IPublishNewsDao publishNewsDao) {
		super(publishNewsDao);
		this.publishNewsDao = publishNewsDao;
	}
	
	/**
	 * 根据条件查询记录
	 * @author Mengxiangliang
	 * @param  QueryExample
	 * @return PublishNewsList
	 * @throws BusinessException
	 */
	public List<Map> searchPublishNewsList(QueryExample qe) throws BusinessException{
	  
	   return publishNewsDao.searchPublishNewsList(qe);
	   
	}
	
	/**
	 * 根据ID查询记录
	 * @author Mengxiangliang
	 * @param Long id
	 * @return domain
	 * @throws BusinessException
	 */
	public PublishNews searchPublishNewsById(Long id) throws BusinessException{
	  
	   return publishNewsDao.searchPublishNewsById(id);
	   
	}

	/**
	 *  删除记录
	 * @author Mengxiangliang	 
	 * @param id
	 * @throws BusinessException
	 */
	public void deletePublishNewsById(Long id) throws BusinessException{
	 
	  publishNewsDao.deletePublishNewsById(id);
	  
	}
	
	/**
	 * 修改记录
	 * @author Mengxiangliang
	 * @param domain
	 * @throws BusinessException
	 */
	public void updatePublishNews(PublishNews domain) throws BusinessException{
	
	   publishNewsDao.save(domain);
	   
	}

	/**
	 * 新增记录
	 * @author Mengxiangliang
	 * @param domain
	 * @return
	 * @throws BusinessException
	 */
	public void createPublishNews(PublishNews domain) throws BusinessException{
	
	   publishNewsDao.save(domain);
	}

	@Override
	public List<Map> searchPublishNewsByWhere(QueryExample qe,
			PublishNews domain) throws BusinessException {
		// TODO Auto-generated method stub
		return publishNewsDao.searchPublishNewsByWhere(qe, domain);
	}

	@Override
	public PublishNews searchPublishNewsByClass(String classCode)
			throws BusinessException {
		// TODO Auto-generated method stub
		return publishNewsDao.searchPublishNewsByClass(classCode);
	}
	

}